.\" SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause
.TH STM32WRAPPER4DBG 1 "2021-01-16"

.SH NAME
stm32wrapper4dbg \- Add debug wrapper to a stm32 fsbl image

.SH SYNOPSIS
.B stm32wrapper4dbg
.RB "" "\-s " "\fIsrcimage\fP" " \-d " "\fIdstimage\fP [" "\-b" "] [" "\-f" "]"
.P
.B stm32wrapper4dbg
.RB "" "\-V"

.SH "DESCRIPTION"
The
.B stm32wrapper4dbg
command is used to add a debug wrapper around the
.B first stage boot loader
(fsbl) images for the
.B STM32MPxxx
processor family.
The wrapper opens the debug port to allow debugging all the software
components in the boot chain.

The wrapped image will be loaded at the same memory addresses of the
original image, thus preserving the address of all the symbols.

The wrapper requires less then 64 bytes; the original image should be
smaller than the available memory to allow both wrapper and image to be
loaded together.

By default the wrapper is loaded in memory
.B after
the image, so the image in \fIdstimage\fP will start at the same memory
address of \fIsrcimage\fP.

.SH "OPTIONS"
.TP
.BI "\-s " "\fIsrcimage\fP"
Read the fsbl image to be wrapped from \fIsrcimage\fP file.

.TP
.BI "\-d " "\fIdstimage\fP"
Write the wrapped fsbl image in \fIdstimage\fP file.

.TP
.BI "\-b"
Add the wrapper
.B before
the image. The image in \fIdstimage\fP will end at the same memory address
of \fIsrcimage\fP.

.TP
.BI "\-f"
Force adding an additional instance of the wrapper to an image file that
already contains the wrapper.

.TP
.BI "\-V"
Display tool version and quit.

.SH EXAMPLES
Wrap the image in a file, then write it to the first partition of the SD card:
.sp
.RS 4
.nf
\fB
stm32wrapper4dbg -f fsbl.stm32 -d wrapped.stm32
dd if=wrapped.stm32 of=/dev/sdd1
.fi \fR
.P
.RE
.P
Wrap the image in the second partition of the SD card and write it to the first partition of the same SD card:
.sp
.RS 4
.nf
\fB
stm32wrapper4dbg -f /dev/sdd2 -d /dev/sdd1
.fi \fR
.P
.RE
.P

.SH AUTHORS
Antonio Borneo <antonio.borneo@st.com>

.SH COPYRIGHT
Copyright \(co 2020-2021 STMicroelectronics - All Rights Reserved
.br
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
